<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title></title>
 <#include "/header.ftl">
</head>
<body>
<div id="app">
    <h1>休学管理</h1>
    <div>
        <el-table
                :data="tableData3"
                stripe
                style="width: 100%">
            <el-table-column
                    prop="transactionId"
                    label="序号">
            </el-table-column>

            <el-table-column
                    prop="transactionReasonRequest"
                    label="申请类型">

            </el-table-column>
            <el-table-column
                    prop="transactionApplyDate"
                    label="申请日期" :formatter = "dateFormat" >

            </el-table-column>
            <el-table-column
                    prop="transactionResponseState"
                    label="审核状态">

            </el-table-column>
            <el-table-column
                    prop="transactionCurrentState"
                    label="现状">

            </el-table-column>
            <el-table-column
                    prop="transactionStartDate"
                    label="批准日期" :formatter = "dateFormat" >

            </el-table-column>
        </el-table>
        <div class="block">
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page.sync="pageIndex"
                    :page-size="pageSize"
                    layout="prev, pager, next, jumper"
                    :total="total">
            </el-pagination>
        </div>
    </div>
</div>
<#include "/footer.ftl">
<script>
    let _this=new Vue({
        el:'#app',
        data:{
            pageIndex:1,
            total:0,
            pageSize:5,
            tableData3: []
        },
        created:function () {
            this.getTransactionList();
        },
        methods: {
            /*日期格式化*/
            dateFormat: function (row, column) {
                let val = row[column.property];
                //console.log(date);
                let date = new Date(val);
                return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
            },
            handleSizeChange: function(val) {
            },
            handleCurrentChange :function(val) {
                this.pageIndex = val;
                this.getTransactionList();
            },
            getTransactionList:function() {
                $.ajax({
                    type:'post',
                    url:'/api/student/transaction/queryTransaction',
                    data:{pageIndex: this.pageIndex},
                    dataType:'json',
                    success:function (res) {
                        _this.total = res.resData.total;
                        _this.pageSize = res.resData.pageSize;
                        _this.tableData3 = res.resData.list;
                    },
                    error : function(error) {
                        console.log('接口不通' + error);
                    }
                })

            }
        }
    })
</script>
</body>
</html>
